import useServer from "server";
import { TaskType } from "types";
import { useQuery } from "react-query";

export const useTasks = (param?: Partial<TaskType>) => {
  const client = useServer();

  return useQuery<TaskType[]>(["tasks", param], () => {
    return client("tasks", { data: param });
  });
};
